﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using RRRSRoguelike.Enums;
using RRRSRoguelike.Helpers.Visualizer;
using RRRSRoguelike.Managers;
using RRRSRoguelikeData;
using System.Net;
using System.Text;
using System.IO;
using System.Diagnostics;
using System.Collections.Specialized;

namespace RRRSRoguelike.Helpers.Webservice
{
    class HighScoreAPI
    {
        public void SubmitScore(string guid, string name, int score, string ruleset, string version, int seed)
        {
            string URI = "http://ancientblade.azurewebsites.net/api/highscore";

            string seedString = seed.ToString();

            string myParameters = "=guid94723|" + name + "|" + score + "|" + ruleset + "|" + version + "|" + seedString;

            using (WebClient wc = new WebClient())
            {
                wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
                string HtmlResult = wc.UploadString(URI, "POST", myParameters);
            }

            Process.Start("http://ancientblade.azurewebsites.net");   
        }
    }
}
